<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 

<style>
	#search{		
		margin-right: 9px;
	}
	
	input {
		margin-right: 9px;
		margin-left: 4px;
		margin-bottom: 3px;
	}
</style>

<div width="950px" style="text-align:left;" >
<p>CDI資料表搜尋</p>

	<form id="f1" action="<c:url value="/report06/find.do"/>" method="post">	
	</form>

<table border="1">
	<tr>
		<td width="300px">
		</td>
		<td width="300px">
		</td>
		<td width="300px">
		</td>
		<td width="300px">
		</td>
		<td width="300px">
		</td>
	</tr>

<tr>
<td>	
<input type="checkbox" id="CDIID_ID" name="CDIID" columnType="String">
客訴編號<input type="text" id="CDIID" name="CDIID" disabled="disabled" >
</td>

<td>
客訴判定:<select name="IsCDIEstablish6" id="IsCDIEstablish6">
	<option value="">請選擇</option>
	<option value="Y">判定成立</option>
	<option value="N">判定不成立</option>
	<option value="YN">未判定</option>
</select>
</td>

<!-- 
<td>
<input type="checkbox" id="search" name="DutyUnit1" columnType="String">權責單位<input type="text" name="DutyUnit1" disabled="disabled" >
</td>
 -->

<td>
<input type="checkbox" name="typeSearch" columnType="String">
客訴類別(反映類別)
<input type="text"  id="typeSearch" name="typeSearch"  disabled="disabled"  value="${TypeName}">
<input type="hidden" name="TypeId" id="TypeId" value="${TypeId}" >
<input type="hidden" name="TypeName" id="TypeName" value="${TypeName}">
<br>(請輸入關鍵字搜尋,至少一個字)
</td>

<td>
<input type="checkbox" id="search" name="custSearch" columnType="String">
客戶名稱
		<input type="text"  id="custSearch" name="custSearch" value="${custName}" disabled="disabled">
		<input type="hidden"  name="custId" id="custId" value="${custId}" >
		<input type="hidden"  name="custName" id="custName" value="${custName}" >
		<br>(請輸入關鍵字搜尋,至少兩個字)
<br>
</td>
<td>&nbsp;</td>
</tr>

<tr>
<td>
產品類別:<select name="ProductType" id="ProductType">
	<option value="">請選擇</option>
	<c:forEach var="pt" items="${productTypeMap}">
		<option value="${pt.key}">${pt.value}</option>
	</c:forEach>
</select>
</td>

<td>
<input type="checkbox" id="NewProduct_ID" name="NewProduct" columnType="String">
新品號:<input type="text" name="NewProduct" id="NewProduct" disabled="disabled" >
</td>

<td>
<input type="checkbox" id="OldProduct_ID" name="OldProduct" columnType="String">
舊品號:<input type="text" name="OldProduct" id="OldProduct" disabled="disabled" >
</td>



<td>
異常現象:
<select name="UnusualType" id="UnusualType">
	<option value="">請選擇</option>
	<c:forEach var="u" items="${unusualTypeMap }">
		<option value="${u.key }">${u.value }</option>
	</c:forEach>
</select>
<br>
</td>

<td>

</td>

</tr>

<tr>
<td>
<input type="checkbox" id="search" name="salesSearch" columnType="String">
業務/負責人員:
		<input type="text"  name="salesSearch" id="salesSearch" value="${salesID}" disabled="disabled" >
		<input type="hidden"  name="salesID"  id="salesID" value="${salesID}">
		<br>(請輸入關鍵字搜尋,至少一個字)
<br>
</td>		

<td>
生產地:
<select name="MadeIn" id="MadeIn">
	<option value="">請選擇</option>
	<c:forEach var="m" items="${madeinMap }">
		<option value="${m.key }">${m.value }</option>
	</c:forEach>
</select>
</td>

<td>
是否再發:
<select name="IsSendAgain" id="IsSendAgain">
	<option value="">請選擇</option>
	<option value="Y">是</option>
	<option value="N">否</option>
</select>
<br>
</td>


<td>
客戶送樣承認:
<select name="IsCustSampleAdmit" id="IsCustSampleAdmit">
	<option value="">請選擇</option>
	<option value="Y">是</option>
	<option value="N">否</option>
</select>
<br>
</td>

<td>
首批交貨:
<select name="IsFirstDelivery" id="IsFirstDelivery">
	<option value="">請選擇</option>
	<option value="Y">是</option>
	<option value="N">否</option>
</select>
<br>
</td>
</tr>


<tr>
<td>
<input type="checkbox"  name="CustAreaSearch" columnType="String">
區域別
<input type="text" name="CustAreaSearch" id="CustAreaSearch" disabled="disabled"  value="${CustAreaName}">
<input type="hidden" name="CustAreaId" id="CustAreaId" value="${CustAreaId }">
<input type="hidden" name="CustAreaName"  id="CustAreaName" value="${CustAreaName}">
<br>(請輸入關鍵字搜尋,至少兩個字)
</td>

<!-- 
<td>
<input type="checkbox" id="search" name="FlowFlag" columnType="String">流程狀態<input type="text" name="FlowFlag" disabled="disabled" >
</td>
 -->

<td>
客訴成立與否:
<select name="IsCDIEstablish6" id="IsCDIEstablish6">
	<option value="">請選擇</option>
	<option value="Y">是</option>
	<option value="N">否</option>
</select>
<br>
</td>

<td>
<input type="checkbox" id="search" name="DetetminePrinciple6" columnType="String">
判定原則
<input type="text" name="DetetminePrinciple6"  id="DetetminePrinciple6" disabled="disabled" value="${DetetminePrinciple6Name }" >
<input type="hidden" name="DetetminePrinciple6Id" id="DetetminePrinciple6Id" value="${DetetminePrinciple6Id }">
<input type="hidden" name="DetetminePrinciple6Name" id="DetetminePrinciple6Name" value="${DetetminePrinciple6Name}">
		<br>(請輸入關鍵字搜尋,至少一個字)
</td>

<td>
<input type="checkbox" id="search" name="DutyUnit6_2" columnType="String" >
客訴判定-權責單位<input type="text" name="DutyUnit6_2" id="DutyUnit6_2" disabled="disabled" value="${DutyUnit6_2Name}" >
<input type="hidden" name="DutyUnit6_2Id" id="DutyUnit6_2Id" value="${DutyUnit6_2Id}">
<input type="hidden" name="DutyUnit6_2Name" id="DutyUnit6_2Name" value="${DutyUnit6_2Name}">
<br>(請輸入關鍵字搜尋,至少一個字)
</td>
<td>&nbsp;</td>
</tr>


<tr>
<td>
<input type="checkbox" id="search" name="StartDate" columnType="Time">開單日期<br>
<input type="text" name="StartDate_Start" disabled="disabled" columnType="Time"  size='9'>~<input type="text" name="StartDate_End" disabled="disabled" columnType="Time" size='9' ><br>
</td>

<td>
<input type="checkbox" id="search" name="SFDate" columnType="Time">對策回覆日期<br>
<input type="text" name="SFDate_Start" disabled="disabled" columnType="Time" size='9' >~<input type="text" name="SFDate_End" disabled="disabled" columnType="Time"  size='9'><br>
</td>

<td>
<input type="checkbox" id="search" name="FinishDetetmineDate6" columnType="Time">判定日<br>
<input type="text" name="FinishDetetmineDate6_Start" disabled="disabled" columnType="Time" size='9' >~<input type="text" name="FinishDetetmineDate6_End" disabled="disabled" columnType="Time" size='9' ><br>
</td>

<td>
<input type="checkbox" id="search" name="FinishDate" columnType="Time">結案日<br>
<input type="text" name="FinishDate_Start" disabled="disabled" columnType="Time"  size='9' >~<input type="text" name="FinishDate_End" disabled="disabled" columnType="Time" size='9' ><br>
</td>

<td>
<input type="checkbox" id="search" name="AcceptDate" columnType="Time">受理日期<br>
<input type="text" name="AcceptDate_Start" disabled="disabled" columnType="Time"  size='9' >~<input type="text" name="AcceptDate_End" disabled="disabled" columnType="Time" size='9' ><br>
</td>


</table>


<div>
<!-- 
<input type="checkbox" id="search" name="UnusualTouchPoint" columnType="String">異常模穴<input type="text" name="UnusualTouchPoint" disabled="disabled" >
<input type="checkbox" id="search" name="UnusualPart" columnType="String">異常部位<input type="text" name="UnusualPart" disabled="disabled" ><br>
<input type="checkbox" id="search" name="WhereHappen" columnType="String">發生地點<input type="text" name="WhereHappen" disabled="disabled" >
<input type="checkbox" id="search" name="HowHappen" columnType="String">如何發生異常<input type="text" name="HowHappen" disabled="disabled" >
<input type="checkbox" id="search" name="MadeNo" columnType="String">製令編號<input type="text" name="MadeNo" disabled="disabled" ><br>
<input type="checkbox" id="search" name="UnusualRate" columnType="String">異常頻度<input type="text" name="UnusualRate" disabled="disabled" >
<input type="checkbox" id="search" name="UnusualRoll" columnType="String">異常數/捲<input type="text" name="UnusualRoll" disabled="disabled" >
<input type="checkbox" id="search" name="CustStock" columnType="String">客戶庫存<input type="text" name="CustStock" disabled="disabled" ><br>
<input type="checkbox" id="search" name="CustProductID" columnType="String">客戶品號<input type="text" name="CustProductID" disabled="disabled" >
<input type="checkbox" id="search" name="PlugID1" columnType="String">端子類膠盒合配件<input type="text" name="PlugID1" disabled="disabled" >
<input type="checkbox" id="search" name="PlugNO1" columnType="String">端子類膠盒合配P.No.<input type="text" name="PlugNO1" disabled="disabled" ><br>
<input type="checkbox" id="search" name="PlugID2" columnType="String">端子類端子對手件<input type="text" name="PlugID2" disabled="disabled" >
<input type="checkbox" id="search" name="PlugNO2" columnType="String">端子類端子對手P.No.<input type="text" name="PlugNO2" disabled="disabled" >
<input type="checkbox" id="search" name="PlugID3" columnType="String">端子類膠盒對手件<input type="text" name="PlugID3" disabled="disabled" ><br>
<input type="checkbox" id="search" name="PlugNO3" columnType="String">端子類膠核對手P.No.<input type="text" name="PlugNO3" disabled="disabled" >
<input type="checkbox" id="search" name="PlugID4" columnType="String">膠盒類端子合配件<input type="text" name="PlugID4" disabled="disabled" >
<input type="checkbox" id="search" name="PlugNO4" columnType="String">膠盒類端子合配P.No.<input type="text" name="PlugNO4" disabled="disabled" ><br>
<input type="checkbox" id="search" name="PlugID5" columnType="String">膠盒類端子對手件<input type="text" name="PlugID5" disabled="disabled" >
<input type="checkbox" id="search" name="PlugNO5" columnType="String">膠盒類端子對手P.No.<input type="text" name="PlugNO5" disabled="disabled" >
<input type="checkbox" id="search" name="PlugID6" columnType="String">膠盒類膠盒對手件<input type="text" name="PlugID6" disabled="disabled" ><br>
<input type="checkbox" id="search" name="PlugNO6" columnType="String">膠盒類膠核對手P.No.<input type="text" name="PlugNO6" disabled="disabled" >
<input type="checkbox" id="search" name="ClipParam1" columnType="String">夾片裝配鈑金孔孔徑<input type="text" name="ClipParam1" disabled="disabled" >
<input type="checkbox" id="search" name="ClipParam2" columnType="String">夾片板厚<input type="text" name="ClipParam2" disabled="disabled" ><br>
<input type="checkbox" id="search" name="RubberParam1" columnType="String">橡膠類使用線種<input type="text" name="RubberParam1" disabled="disabled" >
<input type="checkbox" id="search" name="RubberParam2" columnType="String">橡膠類線徑<input type="text" name="RubberParam2" disabled="disabled" >
<input type="checkbox" id="search" name="RubberParam3" columnType="String">橡膠類膠盒<input type="text" name="RubberParam3" disabled="disabled" ><br>
<input type="checkbox" id="search" name="RubberNO" columnType="String">橡膠類P.No.<input type="text" name="RubberNO" disabled="disabled" >
<input type="checkbox" id="search" name="CDINote" columnType="String">說明<input type="text" name="CDINote" disabled="disabled" >
<input type="checkbox" id="search" name="IsUnusualSampleOffer" columnType="String">異常樣品提供<input type="text" name="IsUnusualSampleOffer" disabled="disabled" >
<input type="checkbox" id="search" name="CustRequireDoc" columnType="String">客戶要求文件<input type="text" name="CustRequireDoc" disabled="disabled" >
<input type="checkbox" id="search" name="OtherNote" columnType="String">其他說明<input type="text" name="OtherNote" disabled="disabled" >
<input type="checkbox" id="search" name="CustRequireProduct" columnType="String">客戶要求產品<input type="text" name="CustRequireProduct" disabled="disabled" ><br>
<input type="checkbox" id="search" name="DutyUnit2" columnType="String">品保指派-權責單位<input type="text" name="DutyUnit2" disabled="disabled" >
<input type="checkbox" id="search" name="Undertaker2" columnType="String">品保指派-承辦人員<input type="text" name="Undertaker2" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUnit2" columnType="String">品保指派-接收單位<input type="text" name="AcceptUnit2" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AcceptUser2" columnType="String">品保指派-接收人員<input type="text" name="AcceptUser2" disabled="disabled" >
<input type="checkbox" id="search" name="Memo2" columnType="String">品保指派-備註<input type="text" name="Memo2" disabled="disabled" >
<input type="checkbox" id="search" name="updateUser" columnType="String">更新者<input type="text" name="updateUser" disabled="disabled" ><br>
<input type="checkbox" id="search" name="DutyUnit3" columnType="String">品管指派-權責單位<input type="text" name="DutyUnit3" disabled="disabled" >
<input type="checkbox" id="search" name="Undertaker3" columnType="String">品管指派-承辦人員<input type="text" name="Undertaker3" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AcceptUnit3" columnType="String">品管指派-接收單位<input type="text" name="AcceptUnit3" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUser3" columnType="String">品管指派-接收人員<input type="text" name="AcceptUser3" disabled="disabled" >
<input type="checkbox" id="search" name="Memo3" columnType="String">品管指派-備註<input type="text" name="Memo3" disabled="disabled" ><br>
<input type="checkbox" id="search" name="DutyUnit4" columnType="String">初步調查-權責單位<input type="text" name="DutyUnit4" disabled="disabled" >
<input type="checkbox" id="search" name="Undertaker4" columnType="String">初步調查-承辦人員<input type="text" name="Undertaker4" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUnit4" columnType="String">初步調查-接收單位<input type="text" name="AcceptUnit4" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AcceptUser4" columnType="String">初步調查-接收人員<input type="text" name="AcceptUser4" disabled="disabled" >
<input type="checkbox" id="search" name="Memo4" columnType="String">初步調查-備註<input type="text" name="Memo4" disabled="disabled" >
<input type="checkbox" id="search" name="SurveyDef4" columnType="String">初步調查與問題定義<input type="text" name="SurveyDef4" disabled="disabled" ><br>
<input type="checkbox" id="search" name="DutyLeader4" columnType="String">初步調查-權責主管<input type="text" name="DutyLeader4" disabled="disabled" >
<input type="checkbox" id="search" name="AuthorizeOpinion4" columnType="String">初步調查-簽核意見<input type="text" name="AuthorizeOpinion4" disabled="disabled" >
<input type="checkbox" id="search" name="SurveyInfo4" columnType="String">初步調查-簽核資訊<input type="text" name="SurveyInfo4" disabled="disabled" ><br>
<input type="checkbox" id="search" name="DutyUnit5" columnType="String">初步回覆-權責單位<input type="text" name="DutyUnit5" disabled="disabled" >
<input type="checkbox" id="search" name="Undertaker5" columnType="String">初步回覆-承辦人員<input type="text" name="Undertaker5" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUnit5" columnType="String">初步回覆-接收單位<input type="text" name="AcceptUnit5" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AcceptUser5" columnType="String">初步回覆-接收人員<input type="text" name="AcceptUser5" disabled="disabled" >
<input type="checkbox" id="search" name="Memo5" columnType="String">初步回覆-備註<input type="text" name="Memo5" disabled="disabled" >
<input type="checkbox" id="search" name="DutyLeader5" columnType="String">初步回覆-備權責主管<input type="text" name="DutyLeader5" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AuthorizeOpinion5" columnType="String">初步回覆-簽核意見<input type="text" name="AuthorizeOpinion5" disabled="disabled" >
<input type="checkbox" id="search" name="DutyUnit6" columnType="String">客訴判定-權責單位<input type="text" name="DutyUnit6" disabled="disabled" >
<input type="checkbox" id="search" name="Undertaker6" columnType="String">客訴判定-承辦人員<input type="text" name="Undertaker6" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AcceptUnit6" columnType="String">客訴判定-接收單位<input type="text" name="AcceptUnit6" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUser6" columnType="String">客訴判定-接收人員<input type="text" name="AcceptUser6" disabled="disabled" >
<input type="checkbox" id="search" name="Memo6" columnType="String">客訴判定-備註<input type="text" name="Memo6" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AuthorizeLeader6" columnType="String">客訴判定-簽核主管<input type="text" name="AuthorizeLeader6" disabled="disabled" >
<input type="checkbox" id="search" name="AuthorizeOpinion6" columnType="String">客訴判定-簽核意見<input type="text" name="AuthorizeOpinion6" disabled="disabled" >
<input type="checkbox" id="search" name="DutyUnit7" columnType="String">真因分析-權責單位<input type="text" name="DutyUnit7" disabled="disabled" ><br>
<input type="checkbox" id="search" name="Undertaker7" columnType="String">真因分析-承辦人員<input type="text" name="Undertaker7" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUnit7" columnType="String">真因分析-接收單位<input type="text" name="AcceptUnit7" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUser7" columnType="String">真因分析-接收人員<input type="text" name="AcceptUser7" disabled="disabled" ><br>
<input type="checkbox" id="search" name="Memo7" columnType="String">真因分析-備註<input type="text" name="Memo7" disabled="disabled" >
<input type="checkbox" id="search" name="ReasonAnalyze7" columnType="String">真因分析<input type="text" name="ReasonAnalyze7" disabled="disabled" >
<input type="checkbox" id="search" name="AuthorizeLeader7" columnType="String">真因分析-簽核主管<input type="text" name="AuthorizeLeader7" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AuthorizeOpinion7" columnType="String">真因分析-簽核意見<input type="text" name="AuthorizeOpinion7" disabled="disabled" >
<input type="checkbox" id="search" name="DutyUnit8" columnType="String">永久對策-權責單位<input type="text" name="DutyUnit8" disabled="disabled" >
<input type="checkbox" id="search" name="Undertaker8" columnType="String">永久對策-承辦人員<input type="text" name="Undertaker8" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AcceptUnit8" columnType="String">永久對策-接收單位<input type="text" name="AcceptUnit8" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUser8" columnType="String">永久對策-接收人員<input type="text" name="AcceptUser8" disabled="disabled" >
<input type="checkbox" id="search" name="Memo8" columnType="String">永久對策-備註<input type="text" name="Memo8" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AuthorizeLeader8" columnType="String">永久對策-簽核主管<input type="text" name="AuthorizeLeader8" disabled="disabled" >
<input type="checkbox" id="search" name="AuthorizeOpinion8" columnType="String">永久對策-簽核意見<input type="text" name="AuthorizeOpinion8" disabled="disabled" >
<input type="checkbox" id="search" name="DutyUnit9" columnType="String">客戶確認-權責單位<input type="text" name="DutyUnit9" disabled="disabled" ><br>
<input type="checkbox" id="search" name="Undertaker9" columnType="String">客戶確認-承辦人員<input type="text" name="Undertaker9" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUnit9" columnType="String">客戶確認-接收單位<input type="text" name="AcceptUnit9" disabled="disabled" >
<input type="checkbox" id="search" name="AcceptUser9" columnType="String">客戶確認-接收人員<input type="text" name="AcceptUser9" disabled="disabled" ><br>
<input type="checkbox" id="search" name="Memo9" columnType="String">客戶確認-備註<input type="text" name="Memo9" disabled="disabled" >
<input type="checkbox" id="search" name="Reply9" columnType="String">客戶回覆內容<input type="text" name="Reply9" disabled="disabled" >
<input type="checkbox" id="search" name="Result9" columnType="String">客戶確認結果<input type="text" name="Result9" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AuthorizeLeader10" columnType="String">處級審核-處級人員
<input type="text" name="AuthorizeLeader10" disabled="disabled" >
<input type="checkbox" id="search" name="AuthorizeOpinion10" columnType="String">處級審核-簽核意見
<input type="text" name="AuthorizeOpinion10" disabled="disabled" >
<input type="checkbox" id="search" name="DutyUnit11" columnType="String">追蹤確認-權責單位<input type="text" name="DutyUnit11" disabled="disabled" ><br>
<input type="checkbox" id="search" name="Undertaker11" columnType="String">追蹤確認-承辦人員<input type="text" name="Undertaker11" disabled="disabled" >
<input type="checkbox" id="search" name="Memo11" columnType="String">追蹤確認-備註<input type="text" name="Memo11" disabled="disabled" >
<input type="checkbox" id="search" name="AuthorizeLeader11" columnType="String">追蹤確認-簽核主管<input type="text" name="AuthorizeLeader11" disabled="disabled" ><br>
<input type="checkbox" id="search" name="AuthorizeOpinion11" columnType="String">追蹤確認-簽核意見<input type="text" name="AuthorizeOpinion11" disabled="disabled" ><br>
<input type="text" name="AcceptDate_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AcceptDate_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="SampleOfferDate" columnType="Time">樣品提供日
<input type="text" name="SampleOfferDate_Start" disabled="disabled" columnType="Time" >~<input type="text" name="SampleOfferDate_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="CustRequireDate" columnType="Time">客戶要求產品
<input type="text" name="CustRequireDate_Start" disabled="disabled" columnType="Time" >~<input type="text" name="CustRequireDate_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AssignDate2" columnType="Time">品保指派-完成指派日期
<input type="text" name="AssignDate2_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AssignDate2_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="updateTime" columnType="Time">更新時間
<input type="text" name="updateTime_Start" disabled="disabled" columnType="Time" >~<input type="text" name="updateTime_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AssignDate3" columnType="Time">品管指派-完成指派日期
<input type="text" name="AssignDate3_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AssignDate3_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="SurveyDate4" columnType="Time">.初步調查-初步調查與問題定義
<input type="text" name="SurveyDate4_Start" disabled="disabled" columnType="Time" >~<input type="text" name="SurveyDate4_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AuthorizeDate4" columnType="Time">初步調查-簽核時間
<input type="text" name="AuthorizeDate4_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AuthorizeDate4_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="SurveyDate5" columnType="Time">完成初步調查日期<input type="text" name="SurveyDate5_Start" disabled="disabled" columnType="Time" >~<input type="text" name="SurveyDate5_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AuthorizeDate5" columnType="Time">初步回覆-完成初步調查日期
<input type="text" name="AuthorizeDate5_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AuthorizeDate5_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="FinishDetetmineDate6" columnType="Time">客訴判定-完成客訴判定日期<input type="text" name="FinishDetetmineDate6_Start" disabled="disabled" columnType="Time" >~<input type="text" name="FinishDetetmineDate6_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AuthorizeDate6" columnType="Time">客訴判定-簽核時間<input type="text" name="AuthorizeDate6_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AuthorizeDate6_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="FinishAnalyzeDate7" columnType="Time">完成真因分析日期
<input type="text" name="FinishAnalyzeDate7_Start" disabled="disabled" columnType="Time" >~<input type="text" name="FinishAnalyzeDate7_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AuthorizeDate7" columnType="Time">真因分析-簽核時間
<input type="text" name="AuthorizeDate7_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AuthorizeDate7_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="FinishForeverDate8" columnType="Time">完成永久對策日期
<input type="text" name="FinishForeverDate8_Start" disabled="disabled" columnType="Time" >~<input type="text" name="FinishForeverDate8_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AuthorizeDate8" columnType="Time">永久對策-簽核時間
<input type="text" name="AuthorizeDate8_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AuthorizeDate8_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="ConfirmDate9" columnType="Time">完成客戶確認日期
<input type="text" name="ConfirmDate9_Start" disabled="disabled" columnType="Time" >~<input type="text" name="ConfirmDate9_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AuthorizeDate10" columnType="Time">處級審核-簽核日期
<input type="text" name="AuthorizeDate10_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AuthorizeDate10_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="ConfirmDate11" columnType="Time">完成追蹤確認日期
<input type="text" name="ConfirmDate11_Start" disabled="disabled" columnType="Time" >~<input type="text" name="ConfirmDate11_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="AuthorizeDate11" columnType="Time">追蹤確認-簽核時間
<input type="text" name="AuthorizeDate11_Start" disabled="disabled" columnType="Time" >~<input type="text" name="AuthorizeDate11_End" disabled="disabled" columnType="Time" ><br>
<input type="checkbox" id="search" name="FinishDate" columnType="Time">完成時間<input type="text" name="FinishDate_Start" disabled="disabled" columnType="Time" >~<input type="text" name="FinishDate_End" disabled="disabled" columnType="Time" ><br>
-->
</div>
	
	
	
	<br>
	<input type="button" id="doSearch" value="搜尋" ><br>
</div>
<script>

$(function() {

	// formate date picker	
	$('input[type=text][columnType=Time]').datepicker({
			dateFormat:"yy-mm-dd",
			changeMonth: true,
			changeYear: true
		});
	
	// 當 checkbox 被勾選時連動 input text 取消 disable. ( ColumnType = String )
	$('input[type=checkbox][columnType=String]').click(function(){
		//alert('alser'+$(this).attr('name'));
		var inputTextName = $(this).attr('name');
		var disabled = !$(this).attr('checked');
		$('input[type=text][name='+inputTextName+']').attr('disabled',disabled);
		if(disabled){
			$('input[type=text][name='+inputTextName+']').val('');
		}	
	});

	// 當 checkbox 被勾選時連動 input text 取消 disable.( ColumnType = Time )
	$('input[type=checkbox][columnType=Time]').click(function(){
		//alert('alser'+$(this).attr('name'));
		var inputTextName_Start = $(this).attr('name')+'_Start';
		var inputTextName_End = $(this).attr('name')+'_End';
		var disabled = !$(this).attr('checked');
		$('input[type=text][name='+inputTextName_Start+']').attr('disabled',disabled);
		$('input[type=text][name='+inputTextName_End+']').attr('disabled',disabled);
		if(disabled){
			$('input[type=text][name='+inputTextName_Start+']').val('');
			$('input[type=text][name='+inputTextName_End+']').val('');
		}
	});

	$('#doSearch').click(function (){

		var i = 0;
		$('input:checked').each(function(){
			i++;
			var columnType = $(this).attr('columnType');
			var name = $(this).attr('name');
			var searchKeyAndValue = "";
			
			
			// if column type = String
			if("String" == columnType){

				var value = '';
				
				if(name == 'custSearch'){
					value = $('input[type=hidden][name="custId"]').val();
					var nameValue = $('input[type=hidden][name="custName"]').val();
					searchKeyAndValue ='String_CustID~!@#'+ value;

					// 這個是為了保留搜尋值
					$("<input type='hidden' name='searchKeyAndValues' value='custId~!@#"+value+"' >").appendTo('#f1');
					$("<input type='hidden' name='searchKeyAndValues' value='custName~!@#"+nameValue+"' >").appendTo('#f1');					 
				}else if (name =='salesSearch'){
					value = $('input[type=hidden][name="salesID"]').val();
					searchKeyAndValue ='String_SalesID~!@#'+ value;
					var nameValue = $('input[type=hidden][name="salesName"]').val();

					// 這個是為了保留搜尋值
					$("<input type='hidden' name='searchKeyAndValues' value='salesID~!@#"+value+"' >").appendTo('#f1');
					$("<input type='hidden' name='searchKeyAndValues' value='salesName~!@#"+nameValue+"' >").appendTo('#f1');
				}else if (name =='typeSearch'){
					value = $('#TypeId').val();
					searchKeyAndValue ='String_Type~!@#'+ value;
					var nameValue = $('input[type=hidden][name="TypeName"]').val();

					// 這個是為了保留搜尋值
					$("<input type='hidden' name='searchKeyAndValues' value='TypeId~!@#"+value+"' >").appendTo('#f1');
					$("<input type='hidden' name='searchKeyAndValues' value='TypeName~!@#"+nameValue+"' >").appendTo('#f1');
				}else if (name =='CustAreaSearch'){
					value = $('#CustAreaId').val();
					searchKeyAndValue ='String_CustArea~!@#'+ value;
					var nameValue = $('input[type=hidden][name="CustAreaName"]').val();

					// 這個是為了保留搜尋值
					$("<input type='hidden' name='searchKeyAndValues' value='CustAreaId~!@#"+value+"' >").appendTo('#f1');
					$("<input type='hidden' name='searchKeyAndValues' value='CustAreaName~!@#"+nameValue+"' >").appendTo('#f1');
				}else if (name =='DetetminePrinciple6'){
					value = $('#DetetminePrinciple6Id').val();
					searchKeyAndValue ='String_DetetminePrinciple6~!@#'+ value;
					var nameValue = $('input[type=hidden][name="DetetminePrinciple6Name"]').val();

					// 這個是為了保留搜尋值
					$("<input type='hidden' name='searchKeyAndValues' value='DetetminePrinciple6Id~!@#"+value+"' >").appendTo('#f1');
					$("<input type='hidden' name='searchKeyAndValues' value='DetetminePrinciple6Name~!@#"+nameValue+"' >").appendTo('#f1');
				}else if (name =='DutyUnit6_2'){
					value = $('#DutyUnit6_2Id').val();
					searchKeyAndValue ='String_DutyUnit6_2~!@#'+ value;
					var nameValue = $('input[type=hidden][name="DutyUnit6_2Name"]').val();

					// 這個是為了保留搜尋值
					$("<input type='hidden' name='searchKeyAndValues' value='DutyUnit6_2Id~!@#"+value+"' >").appendTo('#f1');
					$("<input type='hidden' name='searchKeyAndValues' value='DutyUnit6_2Name~!@#"+nameValue+"' >").appendTo('#f1');
				}else{	
					value = $('input[type=text][name='+name+']').val();
					searchKeyAndValue ='String_'+name +'~!@#'+ value; 
				}
				
			}

			// if columm type = Time
			if("Time" == columnType){
				var startTime = $('input[type=text][name='+name+'_Start]').val();
				var endTime = $('input[type=text][name='+name+'_End]').val();
				searchKeyAndValue ='Time_'+name +'~!@#'+ startTime+'~!@#'+endTime;
				//console.log(name +' - '+ startTime+" ~ "+endTime);
			}

			// add searchKeyAndValue to form
			$("<input type='hidden' name='searchKeyAndValues' value='"+searchKeyAndValue+"' >").appendTo('#f1');
		});

		$('select').each(function(){
			if($(this).val() !='' && null !=$(this).attr('name')){
				i++;
				var name = $(this).attr('name');
				var value = $(this).val();		
				searchKeyAndValue ='String_'+name +'~!@#'+ value; 
				$("<input type='hidden' name='searchKeyAndValues' value='"+searchKeyAndValue+"' >").appendTo('#f1');
				//console.log($(this).val());
			};
		});
		
		if(i<=0){
			alert('請至少填入一項搜尋條件!');
		}else{
			$('#f1').submit();
		}	
				
	});

	 $( "#custSearch" ).autocomplete({
			source: '<c:url value="/ajax/cust.do" />',
			minLength: 2,
			select: function( event, ui ) {	
				$('#custId').val(ui.item.postValue);
				$('#custName').val(ui.item.label);
				$(this).val(ui.item.label);
			}	
		});
	if($('#custSearch').val() != ''){
		$("input[type='checkbox'][name='custSearch']").attr('checked',true);
		$("#custSearch").removeAttr('disabled');
	}

	 $( "#NewProduct" ).autocomplete({
			source: '<c:url value="/ajax/newProduct.do" />',
			minLength: 2,
			select: function( event, ui ) {	
				$(this).val(ui.item.label);
			}	
		});
	 $( "#OldProduct" ).autocomplete({
			source: '<c:url value="/ajax/oldProduct.do" />',
			minLength: 2,
			select: function( event, ui ) {	
				$(this).val(ui.item.label);
			}	
		});

	 $( "#salesSearch" ).autocomplete({
			source: '<c:url value="/ajax/sales.do" />',
			minLength: 1,
			select: function( event, ui ) {	
				$('#salesID').val(ui.item.postValue);
				$(this).val(ui.item.label);
			}	
		});	
	if($('#salesSearch').val() != ''){
			$("input[type='checkbox'][name='salesSearch']").attr('checked',true);
			$("#salesSearch").removeAttr('disabled');
		}
				
	 $( "#typeSearch" ).autocomplete({
			source: '<c:url value="/ajax/type.do" />',
			minLength: 1,
			select: function( event, ui ) {	
				$('#TypeId').val(ui.item.postValue);
				$('#TypeName').val(ui.item.label);
				$(this).val(ui.item.label);
			}	
		});	
	 if($('#typeSearch').val() != ''){
			$("input[type='checkbox'][name='typeSearch']").attr('checked',true);
			$("#typeSearch").removeAttr('disabled');
		}
			
	 $( "#CustAreaSearch" ).autocomplete({
			source: '<c:url value="/ajax/custArea.do" />',
			minLength: 1,
			select: function( event, ui ) {	
				$('#CustAreaId').val(ui.item.postValue);
				$('#CustAreaName').val(ui.item.label);
				$(this).val(ui.item.label);
			}	
		});
	 if($('#CustAreaSearch').val() != ''){
			$("input[type='checkbox'][name='CustAreaSearch']").attr('checked',true);
			$("#CustAreaSearch").removeAttr('disabled');
		}
		
	 $( "#DetetminePrinciple6" ).autocomplete({
			source: '<c:url value="/ajax/detetminePrinciple6.do" />',
			minLength: 1,
			select: function( event, ui ) {	
				$('#DetetminePrinciple6Id').val(ui.item.postValue);
				$('#DetetminePrinciple6Name').val(ui.item.label);
				$(this).val(ui.item.label);
			}	
		});	
	 if($('#DetetminePrinciple6').val() != ''){
			$("input[type='checkbox'][name='DetetminePrinciple6']").attr('checked',true);
			$("#DetetminePrinciple6").removeAttr('disabled');
		}
	 
	 $( "#DutyUnit6_2" ).autocomplete({
			source: '<c:url value="/ajax/dutyUnit6_2.do" />',
			minLength: 1,
			select: function( event, ui ) {	
				$('#DutyUnit6_2Id').val(ui.item.postValue);
				$('#DutyUnit6_2Name').val(ui.item.label);
				$(this).val(ui.item.label);
			}	
		});	
	 if($('#DutyUnit6_2').val() != ''){
			$("input[type='checkbox'][name='DutyUnit6_2']").attr('checked',true);
			$("#DutyUnit6_2").removeAttr('disabled');
		}		
	 	
	 

	 // 回填上次的搜尋選項
	 <c:if test="${not empty CDIID}">
	 	$( "#CDIID_ID" ).attr('checked',true);
	 	$( "#CDIID" ).val('${CDIID}');
	 	$( "#CDIID" ).attr('disabled',false);
	 </c:if>
	 <c:if test="${not empty IsCDIEstablish6}">
	 	$( "#IsCDIEstablish6" ).val('${IsCDIEstablish6}');
	 </c:if>
	 <c:if test="${not empty ProductType}">
	 	$( "#ProductType" ).val('${ProductType}');
	 </c:if>
	 <c:if test="${not empty NewProduct}">
	 	$( "#NewProduct_ID" ).attr('checked',true);
	 	$( "#NewProduct" ).val('${NewProduct}');
	 	$( "#NewProduct" ).attr('disabled',false);
	 </c:if>	 
	 <c:if test="${not empty OldProduct}">
	 	$( "#OldProduct_ID" ).attr('checked',true);
	 	$( "#OldProduct" ).val('${OldProduct}');
	 	$( "#OldProduct" ).attr('disabled',false);
	 </c:if>		 
	 <c:if test="${not empty UnusualType}">
	 	$( "#UnusualType" ).val('${UnusualType}');
	 </c:if>
	 <c:if test="${not empty MadeIn }">
	 	$( "#MadeIn" ).val('${MadeIn}');
	 </c:if>
	 <c:if test="${not empty IsSendAgain}">
	 	$( "#IsSendAgain" ).val('${IsSendAgain}');
	 </c:if>
	 <c:if test="${not empty IsCustSampleAdmit}">
	 	$( "#IsCustSampleAdmit" ).val('${IsCustSampleAdmit}');
	 </c:if>
	 <c:if test="${not empty IsFirstDelivery}">
	 	$( "#IsFirstDelivery" ).val('${IsFirstDelivery}');
	 </c:if>
	 <c:if test="${not empty IsCDIEstablish6}">
	 	$( "#IsCDIEstablish6" ).val('${IsCDIEstablish6}');
	 </c:if>
	 <c:if test="${not empty IsCDIEstablish6}">
	 	$( "#IsCDIEstablish6" ).val('${IsCDIEstablish6}');
	 </c:if>
	 <c:if test="${not empty StartDate_Start}">
	 	$( "input[type='checkbox'][name='StartDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='StartDate_Start']" ).val('${StartDate_Start}');
	 	$( "input[type='text'][name='StartDate_Start']" ).removeAttr('disabled');
	 </c:if>
	 <c:if test="${not empty StartDate_End}">
	 	$( "input[type='checkbox'][name='StartDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='StartDate_End']" ).val('${StartDate_End}');
	 	$( "input[type='text'][name='StartDate_End']" ).removeAttr('disabled');
	 </c:if>
	 
	 <c:if test="${not empty SFDate_Start}">
	 	$( "input[type='checkbox'][name='SFDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='SFDate_Start']" ).val('${SFDate_Start}');
	 	$( "input[type='text'][name='SFDate_Start']" ).removeAttr('disabled');
	 </c:if>
	 <c:if test="${not empty SFDate_End}">
	 	$( "input[type='checkbox'][name='SFDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='SFDate_End']" ).val('${SFDate_End}');
	 	$( "input[type='text'][name='SFDate_End']" ).removeAttr('disabled');
	 </c:if>	 

	 <c:if test="${not empty DetetmineDate_Start}">
	 	$( "input[type='checkbox'][name='DetetmineDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='DetetmineDate_Start']" ).val('${DetetmineDate_Start}');
	 	$( "input[type='text'][name='DetetmineDate_Start']" ).removeAttr('disabled');
	 </c:if>
	 <c:if test="${not empty DetetmineDate_End}">
	 	$( "input[type='checkbox'][name='DetetmineDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='DetetmineDate_End']" ).val('${DetetmineDate_End}');
	 	$( "input[type='text'][name='DetetmineDate_End']" ).removeAttr('disabled');
	 </c:if>

	 <c:if test="${not empty FinishDetetmineDate6_Start}">
	 	$( "input[type='checkbox'][name='FinishDetetmineDate6']" ).attr('checked',true);
	 	$( "input[type='text'][name='FinishDetetmineDate6_Start']" ).val('${FinishDetetmineDate6_Start}');
	 	$( "input[type='text'][name='FinishDetetmineDate6_Start']" ).removeAttr('disabled');
	 </c:if>
	 <c:if test="${not empty FinishDetetmineDate6_End}">
	 	$( "input[type='checkbox'][name='FinishDetetmineDate6']" ).attr('checked',true);
	 	$( "input[type='text'][name='FinishDetetmineDate6_End']" ).val('${FinishDetetmineDate6_End}');
	 	$( "input[type='text'][name='FinishDetetmineDate6_End']" ).removeAttr('disabled');
	 </c:if>	

	 <c:if test="${not empty CloseDate_Start}">
	 	$( "input[type='checkbox'][name='CloseDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='CloseDate_Start']" ).val('${CloseDate_Start}');
	 	$( "input[type='text'][name='CloseDate_Start']" ).removeAttr('disabled');
	 </c:if>
	 <c:if test="${not empty CloseDate_End}">
	 	$( "input[type='checkbox'][name='CloseDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='CloseDate_End']" ).val('${CloseDate_End}');
	 	$( "input[type='text'][name='CloseDate_End']" ).removeAttr('disabled');
	 </c:if>

	 <c:if test="${not empty FinishDate_Start}">
	 	$( "input[type='checkbox'][name='FinishDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='FinishDate_Start']" ).val('${FinishDate_Start}');
	 	$( "input[type='text'][name='FinishDate_Start']" ).removeAttr('disabled');
	 </c:if>
	 <c:if test="${not empty FinishDate_End}">
	 	$( "input[type='checkbox'][name='FinishDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='FinishDate_End']" ).val('${FinishDate_End}');
	 	$( "input[type='text'][name='FinishDate_End']" ).removeAttr('disabled');
	 </c:if>

	 <c:if test="${not empty AcceptDate_Start}">
	 	$( "input[type='checkbox'][name='AcceptDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='AcceptDate_Start']" ).val('${AcceptDate_Start}');
	 	$( "input[type='text'][name='AcceptDate_Start']" ).removeAttr('disabled');
	 </c:if>
	 <c:if test="${not empty CloseDate_End}">
	 	$( "input[type='checkbox'][name='AcceptDate']" ).attr('checked',true);
	 	$( "input[type='text'][name='AcceptDate_End']" ).val('${AcceptDate_End}');
	 	$( "input[type='text'][name='AcceptDate_End']" ).removeAttr('disabled');
	 </c:if>
	 
	 	
	 
});

</script>

